﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0060)http://www.cppblog.com/zxytim/archive/2009/11/30/102302.html -->
<HTML><HEAD id=Head><TITLE>Sudoku - DancingLinks （数独DancingLinks搜索优化算法） - Tim's Programming Space - C++博客</TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META id=metaKeywords content="Sudoku - DancingLinks （数独DancingLinks搜索优化算法）" 
name=keywords><LINK id=MainCss 
href="Sudoku - DancingLinks （数独DancingLinks搜索优化算法） - Tim's Programming Space - C++博客.files/style.css" 
type=text/css rel=stylesheet><LINK id=RSSLink title=RSS 
href="http://www.cppblog.com/zxytim/rss.aspx" type=application/rss+xml 
rel=alternate>
<META content="MSHTML 6.00.2900.5897" name=GENERATOR></HEAD>
<BODY>
<FORM id=Form1 name=Form1 onsubmit="javascript:return WebForm_OnSubmit();" 
action=102302.html method=post>
<DIV><INPUT id=__EVENTTARGET type=hidden name=__EVENTTARGET> <INPUT 
id=__EVENTARGUMENT type=hidden name=__EVENTARGUMENT> <INPUT 
id="&#13;&#10;__VIEWSTATE" type=hidden name=__VIEWSTATE> </DIV>
<SCRIPT type=text/javascript>
//<![CDATA[
var theForm = document.forms['Form1'];
if (!theForm) {
    theForm = document.Form1;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]>
</SCRIPT>

<SCRIPT 
src="Sudoku - DancingLinks （数独DancingLinks搜索优化算法） - Tim's Programming Space - C++博客.files/WebResource.axd" 
type=text/javascript></SCRIPT>

<SCRIPT language=JavaScript>
									function ctlent(evt,id)
											{
												if(evt.ctrlKey && evt.keyCode == 13)
												{	
													try
													{
														TempSave(id);
													}
													catch(ex)
													{
													}
													finally
													{
													    __doPostBack('AjaxHolder$PostComment$btnSubmit','')
													}
												}
		
												}</SCRIPT>

<SCRIPT language=JavaScript>function SetReplyAuhor(author){document.getElementById('AjaxHolder_PostComment_tbComment').value+="@"+author+"\n";document.getElementById('AjaxHolder_PostComment_tbComment').focus();return false}</SCRIPT>

<SCRIPT 
src="Sudoku - DancingLinks （数独DancingLinks搜索优化算法） - Tim's Programming Space - C++博客.files/ScriptResource.axd" 
type=text/javascript></SCRIPT>

<SCRIPT 
src="G:\l论文资料\sudoku开发参考资料\精确覆盖\Sudoku - DancingLinks （数独DancingLinks搜索优化算法） - Tim's Programming Space - C++博客.files\ScriptResource(1).axd" 
type=text/javascript></SCRIPT>

<SCRIPT 
src="G:\l论文资料\sudoku开发参考资料\精确覆盖\Sudoku - DancingLinks （数独DancingLinks搜索优化算法） - Tim's Programming Space - C++博客.files\ScriptResource(2).axd" 
type=text/javascript></SCRIPT>

<SCRIPT type=text/javascript>
//<![CDATA[
function WebForm_OnSubmit() {
if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) return false;
return true;
}
//]]>
</SCRIPT>

<DIV class=pagelayout>
<TABLE cellSpacing=0 cellPadding=2 width="97%" align=center>
  <TBODY>
  <TR>
    <TD class=mytitle align=middle width="30%"><A class=headermaintitle 
      id=Header1_HeaderTitle href="http://www.cppblog.com/zxytim/">Tim's 
      Programming Space</A></TD>
    <TD>&nbsp;</TD>
    <TD width="50%">
      <TABLE height=30 cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR>
          <TD width=100><A href="http://www.cppblog.com/"><IMG 
            src="Sudoku - DancingLinks （数独DancingLinks搜索优化算法） - Tim's Programming Space - C++博客.files/icon_hjblog.gif" 
            border=0></A></TD>
          <TD width=10><A href="http://www.cppblog.com/logout.aspx"><IMG 
            src="Sudoku - DancingLinks （数独DancingLinks搜索优化算法） - Tim's Programming Space - C++博客.files/out.gif" 
            border=0></A></TD></TR></TBODY></TABLE></TD></TR>
  <TR>
    <TD vAlign=center align=middle 
    background="Sudoku - DancingLinks （数独DancingLinks搜索优化算法） - Tim's Programming Space - C++博客.files/top.jpg" 
    colSpan=3 height=184>Tim's Programming Space</TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=5 width="90%" align=center border=0>
  <TBODY>
  <TR>
    <TD vAlign=top width=200>
      <DIV class=listtitle>日历</DIV>
      <TABLE height=200 width="100%">
        <TBODY>
        <TR>
          <TD>
            <TABLE id=Calendar1_entryCal title=Calendar 
            style="BORDER-RIGHT: #f9fce9 1px solid; BORDER-TOP: #f9fce9 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #f9fce9 1px solid; WIDTH: 100%; COLOR: black; BORDER-BOTTOM: #f9fce9 1px solid; FONT-FAMILY: Verdana; BORDER-COLLAPSE: collapse; HEIGHT: 100%" 
            cellSpacing=0 cellPadding=1 border=0>
              <TBODY>
              <TR>
                <TD style="BACKGROUND-COLOR: #f9fce9" colSpan=7>
                  <TABLE 
                  style="FONT-SIZE: 12px; WIDTH: 100%; COLOR: black; FONT-FAMILY: Verdana; BORDER-COLLAPSE: collapse" 
                  cellSpacing=0 border=0>
                    <TBODY>
                    <TR>
                      <TD style="WIDTH: 15%" vAlign=bottom><A 
                        title="Go to the previous month" style="COLOR: black" 
                        href="javascript:__doPostBack('Calendar1$entryCal','V3561')">&lt;</A></TD>
                      <TD style="WIDTH: 70%" align=middle>2009年11月</TD>
                      <TD style="WIDTH: 15%" vAlign=bottom align=right><A 
                        title="Go to the next month" style="COLOR: black" 
                        href="javascript:__doPostBack('Calendar1$entryCal','V3622')">&gt;</A></TD></TR></TBODY></TABLE></TD></TR>
              <TR>
                <TH 
                style="FONT-WEIGHT: normal; FONT-SIZE: 12px; COLOR: black; FONT-FAMILY: Arial; BACKGROUND-COLOR: #f9fce9" 
                scope=col align=middle abbr=日>日</TH>
                <TH 
                style="FONT-WEIGHT: normal; FONT-SIZE: 12px; COLOR: black; FONT-FAMILY: Arial; BACKGROUND-COLOR: #f9fce9" 
                scope=col align=middle abbr=一>一</TH>
                <TH 
                style="FONT-WEIGHT: normal; FONT-SIZE: 12px; COLOR: black; FONT-FAMILY: Arial; BACKGROUND-COLOR: #f9fce9" 
                scope=col align=middle abbr=二>二</TH>
                <TH 
                style="FONT-WEIGHT: normal; FONT-SIZE: 12px; COLOR: black; FONT-FAMILY: Arial; BACKGROUND-COLOR: #f9fce9" 
                scope=col align=middle abbr=三>三</TH>
                <TH 
                style="FONT-WEIGHT: normal; FONT-SIZE: 12px; COLOR: black; FONT-FAMILY: Arial; BACKGROUND-COLOR: #f9fce9" 
                scope=col align=middle abbr=四>四</TH>
                <TH 
                style="FONT-WEIGHT: normal; FONT-SIZE: 12px; COLOR: black; FONT-FAMILY: Arial; BACKGROUND-COLOR: #f9fce9" 
                scope=col align=middle abbr=五>五</TH>
                <TH 
                style="FONT-WEIGHT: normal; FONT-SIZE: 12px; COLOR: black; FONT-FAMILY: Arial; BACKGROUND-COLOR: #f9fce9" 
                scope=col align=middle abbr=六>六</TH></TR>
              <TR>
                <TD style="WIDTH: 14%; COLOR: #303030" align=middle>25</TD>
                <TD style="WIDTH: 14%; COLOR: #303030" align=middle>26</TD>
                <TD style="WIDTH: 14%; COLOR: #303030" align=middle>27</TD>
                <TD style="WIDTH: 14%; COLOR: #303030" align=middle>28</TD>
                <TD style="WIDTH: 14%; COLOR: #303030" align=middle>29</TD>
                <TD style="WIDTH: 14%; COLOR: #303030" align=middle>30</TD>
                <TD style="WIDTH: 14%; COLOR: #303030" align=middle>31</TD></TR>
              <TR>
                <TD style="WIDTH: 14%" align=middle>1</TD>
                <TD style="WIDTH: 14%" align=middle>2</TD>
                <TD style="WIDTH: 14%" align=middle>3</TD>
                <TD style="WIDTH: 14%" align=middle>4</TD>
                <TD style="WIDTH: 14%" align=middle>5</TD>
                <TD style="WIDTH: 14%" align=middle>6</TD>
                <TD style="WIDTH: 14%" align=middle>7</TD></TR>
              <TR>
                <TD style="WIDTH: 14%" align=middle>8</TD>
                <TD style="WIDTH: 14%" align=middle>9</TD>
                <TD style="WIDTH: 14%" align=middle>10</TD>
                <TD style="WIDTH: 14%" align=middle>11</TD>
                <TD style="WIDTH: 14%" align=middle>12</TD>
                <TD style="WIDTH: 14%" align=middle>13</TD>
                <TD style="WIDTH: 14%" align=middle>14</TD></TR>
              <TR>
                <TD style="WIDTH: 14%" align=middle>15</TD>
                <TD style="WIDTH: 14%" align=middle>16</TD>
                <TD style="WIDTH: 14%" align=middle>17</TD>
                <TD style="WIDTH: 14%" align=middle>18</TD>
                <TD style="WIDTH: 14%" align=middle>19</TD>
                <TD style="WIDTH: 14%" align=middle>20</TD>
                <TD style="WIDTH: 14%" align=middle>21</TD></TR>
              <TR>
                <TD style="WIDTH: 14%" align=middle>22</TD>
                <TD style="WIDTH: 14%" align=middle>23</TD>
                <TD style="WIDTH: 14%" align=middle>24</TD>
                <TD style="WIDTH: 14%" align=middle>25</TD>
                <TD style="WIDTH: 14%" align=middle><A 
                  href="http://www.cppblog.com/zxytim/archive/2009/11/26.html"><U>26</U></A></TD>
                <TD style="WIDTH: 14%" align=middle><A 
                  href="http://www.cppblog.com/zxytim/archive/2009/11/27.html"><U>27</U></A></TD>
                <TD style="WIDTH: 14%" align=middle>28</TD></TR>
              <TR>
                <TD style="WIDTH: 14%" align=middle>29</TD>
                <TD style="WIDTH: 14%" align=middle><A 
                  href="http://www.cppblog.com/zxytim/archive/2009/11/30.html"><U>30</U></A></TD>
                <TD style="WIDTH: 14%; COLOR: #303030" align=middle>1</TD>
                <TD style="WIDTH: 14%; COLOR: #303030" align=middle>2</TD>
                <TD style="WIDTH: 14%; COLOR: #303030" align=middle>3</TD>
                <TD style="WIDTH: 14%; COLOR: #303030" align=middle>4</TD>
                <TD style="WIDTH: 14%; COLOR: #303030" 
              align=middle>5</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
      <DIV class=listtitle>统计</DIV>
      <UL class=list>
        <LI class=listitem>随笔 - 5 
        <LI class=listitem>文章 - 1 
        <LI class=listitem>评论 - 2 
        <LI class=listitem>引用 - 0 </LI></UL>
      <H1 class=listtitle>导航</H1>
      <UL class=list>
        <LI class=listitem><A class=listitem id=MyLinks1_HomeLink 
        href="http://www.cppblog.com/">C++博客</A> 
        <LI class=listitem><A id=MyLinks1_MyHomeLink 
        href="http://www.cppblog.com/zxytim/">首页</A> 
        <LI class=listitem><A id=MyLinks1_NewPostLink 
        href="http://www.cppblog.com/zxytim/admin/EditPosts.aspx?opt=1">发新随笔</A> 

        <LI class=listitem><A class=listitem id=MyLinks1_NewArticleLink 
        href="http://www.cppblog.com/EnterMyBlog.aspx?NewArticle=1">发新文章</A> 
        <LI class=listitem><A class=listitem id=MyLinks1_ContactLink accessKey=9 
        href="http://www.cppblog.com/zxytim/contact.aspx?id=1">联系</A> 
        <LI class=listitem><A class=listitem id=MyLinks1_Syndication 
        href="http://www.cppblog.com/zxytim/Rss.aspx">聚合</A><A 
        id=MyLinks1_XMLLink href="http://www.cppblog.com/zxytim/Rss.aspx"><IMG 
        style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" 
        src="Sudoku - DancingLinks （数独DancingLinks搜索优化算法） - Tim's Programming Space - C++博客.files/xml.gif"></A> 

        <LI class=listitem><A class=listitem id=MyLinks1_Admin 
        href="http://www.cppblog.com/zxytim/admin/EditPosts.aspx">管理</A> 
</LI></UL>
      <H3>常用链接</H3>
      <UL>
        <LI><A id=SingleColumn1_ctl00_repeaterLinks_ctl01_lnkLinkItem 
        href="http://www.cppblog.com/zxytim/MyPosts.html">我的随笔</A> 
        <LI><A id=SingleColumn1_ctl00_repeaterLinks_ctl02_lnkLinkItem 
        href="http://www.cppblog.com/zxytim/MyComments.html">我的评论</A> 
        <LI><A id=SingleColumn1_ctl00_repeaterLinks_ctl03_lnkLinkItem 
        href="http://www.cppblog.com/zxytim/OtherPosts.html">我参与的随笔</A> </LI></UL>
      <H3>留言簿</H3>
      <UL>
        <LI><A id=SingleColumn1__57d816_lnkMessages 
        href="http://www.cppblog.com/zxytim/Contact.aspx?id=1">给我留言</A> 
        <LI><A id=SingleColumn1__57d816_lnkPublicMsgView 
        href="http://www.cppblog.com/zxytim/default.aspx?opt=msg">查看公开留言</A> 
        <LI><A id=SingleColumn1__57d816_lnkPrivateMsgView 
        href="http://www.cppblog.com/zxytim/admin/MyMessages.aspx">查看私人留言</A> 
        </LI></UL>
      <H1 class=listtitle>随笔档案</H1>
      <UL class=list>
        <LI class=listitem><A class=listitem 
        id=SingleColumn1_Categories_CatList_ctl00_LinkList_ctl01_Link 
        href="http://www.cppblog.com/zxytim/archive/2009/11.html">2009年11月 
        (5)</A> </LI></UL>
      <H1 class=listtitle>文章档案</H1>
      <UL class=list>
        <LI class=listitem><A class=listitem 
        id=SingleColumn1_Categories_CatList_ctl01_LinkList_ctl01_Link 
        href="http://www.cppblog.com/zxytim/archives/2009/11.html">2009年11月 
        (1)</A> </LI></UL>
      <SCRIPT language=JavaScript>
function SearchGoogle(key,evt,site)
		{
			if(evt.keyCode==13 || evt.keyCode==0 || evt.type =='click')
			{
				key.focus();
				var keystr = encodeURIComponent(key.value);
				url = "http://www.google.com/search?q=";
				url = url+keystr;
				url += "&ie=UTF-8&oe=GB2312&hl=zh-CN&domains="+site+"&sitesearch="+site;
				window.location=url;
				return false;
			}
		}
</SCRIPT>

      <H3>搜索</H3>
      <UL>
        <LI>
        <LI><INPUT id=q 
        onkeydown="return SearchGoogle(document.getElementById('q'),event,'www.cppblog.com/zxytim')" 
        style="WIDTH: 130px" name=q>&nbsp;<INPUT onclick="SearchGoogle(document.getElementById('q'),event,'www.cppblog.com/zxytim')" type=button value=搜索 name=sa> 
        </LI></UL>
      <H3>最新评论 <A id=SingleColumn1__2729bce_RSSHyperlink1 
      href="http://www.cppblog.com/zxytim/CommentsRSS.aspx"><IMG 
      style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" 
      src="Sudoku - DancingLinks （数独DancingLinks搜索优化算法） - Tim's Programming Space - C++博客.files/xml.gif"></A></H3>
      <DIV class=RecentComment>
      <UL>
        <LI style="WORD-BREAK: break-all"><A 
        id=SingleColumn1__2729bce_CommentList_ctl01_Hyperlink1 
        href="http://www.cppblog.com/zxytim/archive/2009/12/01/102302.html#102340">1.&nbsp;re: 
        Sudoku - DancingLinks （数独DancingLinks搜索优化算法）</A> 
        <LI style="WORD-BREAK: break-all">学习了。谢谢！ 
        <LI style="MARGIN-RIGHT: 4px; TEXT-ALIGN: right">--创意产品批发 
        <LI style="WORD-BREAK: break-all"><A 
        id=SingleColumn1__2729bce_CommentList_ctl02_Hyperlink1 
        href="http://www.cppblog.com/zxytim/archive/2009/11/27/101990.html#102033">2.&nbsp;re: 
        A new Start!</A> 
        <LI style="WORD-BREAK: break-all">orz 
        <LI style="MARGIN-RIGHT: 4px; TEXT-ALIGN: right">--hyf </LI></UL></DIV>
      <H3>阅读排行榜</H3>
      <DIV class=RecentComment>
      <UL style="WORD-BREAK: break-all">
        <LI><A id=SingleColumn1__1262ed9_TopList_ctl01_Hyperlink1 
        href="http://www.cppblog.com/zxytim/archive/2009/11/30/102302.aspx">1.&nbsp;Sudoku 
        - DancingLinks （数独DancingLinks搜索优化算法）(1009)</A> 
        <LI><A id=SingleColumn1__1262ed9_TopList_ctl02_Hyperlink1 
        href="http://www.cppblog.com/zxytim/archive/2009/11/27/102034.aspx">2.&nbsp;SuffixArray 
        后缀数组(979)</A> 
        <LI><A id=SingleColumn1__1262ed9_TopList_ctl03_Hyperlink1 
        href="http://www.cppblog.com/zxytim/archive/2009/11/26/101994.aspx">3.&nbsp;zoj2112 
        Dynamic Rankings (LineSegmentTree + BalancedTree)(742)</A> 
        <LI><A id=SingleColumn1__1262ed9_TopList_ctl04_Hyperlink1 
        href="http://www.cppblog.com/zxytim/archive/2009/11/30/102305.aspx">4.&nbsp;Reminder(24)</A> 

        <LI><A id=SingleColumn1__1262ed9_TopList_ctl05_Hyperlink1 
        href="http://www.cppblog.com/zxytim/archive/2009/11/26/101990.aspx">5.&nbsp;A 
        new Start!(19)</A> </LI></UL></DIV>
      <H3>评论排行榜</H3>
      <DIV class=RecentComment>
      <UL style="WORD-BREAK: break-all">
        <LI><A id=SingleColumn1__2087bee_TopList_ctl01_Hyperlink1 
        href="http://www.cppblog.com/zxytim/archive/2009/11/30/102302.aspx">1.&nbsp;Sudoku 
        - DancingLinks （数独DancingLinks搜索优化算法）(1)</A> 
        <LI><A id=SingleColumn1__2087bee_TopList_ctl02_Hyperlink1 
        href="http://www.cppblog.com/zxytim/archive/2009/11/26/101990.aspx">2.&nbsp;A 
        new Start!(1)</A> 
        <LI><A id=SingleColumn1__2087bee_TopList_ctl03_Hyperlink1 
        href="http://www.cppblog.com/zxytim/archive/2009/11/30/102305.aspx">3.&nbsp;Reminder(0)</A> 

        <LI><A id=SingleColumn1__2087bee_TopList_ctl04_Hyperlink1 
        href="http://www.cppblog.com/zxytim/archive/2009/11/27/102034.aspx">4.&nbsp;SuffixArray 
        后缀数组(0)</A> 
        <LI><A id=SingleColumn1__2087bee_TopList_ctl05_Hyperlink1 
        href="http://www.cppblog.com/zxytim/archive/2009/11/26/101994.aspx">5.&nbsp;zoj2112 
        Dynamic Rankings (LineSegmentTree + BalancedTree)(0)</A> </LI></UL></DIV>
      <DIV class=spacer>&nbsp;</DIV></TD>
    <TD style="PADDING-LEFT: 20px" vAlign=top>
      <DIV class=singlepost>
      <DIV class=posttitle><A class=singleposttitle id=viewpost1_TitleUrl 
      href="http://www.cppblog.com/zxytim/archive/2009/11/30/102302.html">Sudoku 
      - DancingLinks （数独DancingLinks搜索优化算法）</A> 
      </DIV>NOIP2009最后一题。<BR>看到题的时候直接就想到了DancingLinks，但是。。。很后悔是，原来想学的时候觉得难写就没写了。<BR>不过考试时裸搜加最优性剪枝有95分，也很不错了。<BR>DacingLinks其实就是十字链表，用于求解精确覆盖问题：对于一个0-1矩阵，选取一些行使得每列有且只有一个1。<BR>把数独转换为这样一个模型以后就可以用DacingLinks快速的搜索了。<BR>搜索时每次选择1的个数最少的那列，枚举那列上选取的某行，再把那行其他位置有1的列删除，接着继续搜索。回溯时再还原改动。<BR>对于数独而言，一共有9*9个格子，每个格子可以填9个数，所以在0-1矩阵里就有9*9*9=729行，表示在某个格子里填某个数。<BR>同时在某个位置填了某个数后，那个数所在的列，行，9宫格也不能填那个数了，同时那个格子也不能填其他数了，所以某行填某个数有9*9，某列填某个数有9*9，某个9宫格填某个数9*9，某个位置填数9*9，一共就用324列。<BR>建好这样一个图后，就直接用DancingLinks搜索，因为相比一般的裸搜冗余很少，所以速度非常快。<BR>
      <DIV 
      style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><SPAN 
      style="COLOR: #008000">/*</SPAN><SPAN 
      style="COLOR: #008000"><BR>&nbsp;*&nbsp;$File:&nbsp;sudoku.cpp<BR>&nbsp;*&nbsp;$Date:&nbsp;Sun&nbsp;Nov&nbsp;29&nbsp;20:22:32&nbsp;2009&nbsp;CST<BR>&nbsp;</SPAN><SPAN 
      style="COLOR: #008000">*/</SPAN><SPAN 
      style="COLOR: #000000"><BR><BR>#include&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">&lt;</SPAN><SPAN 
      style="COLOR: #000000">iostream</SPAN><SPAN 
      style="COLOR: #000000">&gt;</SPAN><SPAN 
      style="COLOR: #000000"><BR>#include&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">&lt;</SPAN><SPAN 
      style="COLOR: #000000">cstring</SPAN><SPAN 
      style="COLOR: #000000">&gt;</SPAN><SPAN 
      style="COLOR: #000000"><BR>#include&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">&lt;</SPAN><SPAN 
      style="COLOR: #000000">cstdio</SPAN><SPAN 
      style="COLOR: #000000">&gt;</SPAN><SPAN 
      style="COLOR: #000000"><BR>#include&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">&lt;</SPAN><SPAN 
      style="COLOR: #000000">cstdlib</SPAN><SPAN 
      style="COLOR: #000000">&gt;</SPAN><SPAN 
      style="COLOR: #000000"><BR>#include&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">&lt;</SPAN><SPAN 
      style="COLOR: #000000">cmath</SPAN><SPAN 
      style="COLOR: #000000">&gt;</SPAN><SPAN 
      style="COLOR: #000000"><BR><BR></SPAN><SPAN 
      style="COLOR: #0000ff">#define</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;LENGTH&nbsp;9</SPAN><SPAN 
      style="COLOR: #000000"><BR></SPAN><SPAN 
      style="COLOR: #0000ff">#define</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;SQRLEN&nbsp;3</SPAN><SPAN 
      style="COLOR: #000000"><BR></SPAN><SPAN 
      style="COLOR: #0000ff">#define</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;MAXN&nbsp;(LENGTH*LENGTH*LENGTH)</SPAN><SPAN 
      style="COLOR: #000000"><BR></SPAN><SPAN 
      style="COLOR: #0000ff">#define</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;MAXM&nbsp;(4*LENGTH*LENGTH)</SPAN><SPAN 
      style="COLOR: #000000"><BR></SPAN><SPAN 
      style="COLOR: #0000ff">#define</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;MAXNODE&nbsp;MAXN*MAXM</SPAN><SPAN 
      style="COLOR: #000000"><BR><BR></SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;max(</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;a,</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;b){<BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">return</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;a</SPAN><SPAN 
      style="COLOR: #000000">&gt;</SPAN><SPAN 
      style="COLOR: #000000">b</SPAN><SPAN style="COLOR: #000000">?</SPAN><SPAN 
      style="COLOR: #000000">a:b;<BR>}<BR></SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;map[MAXN][MAXM];<BR></SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;U[MAXNODE],D[MAXNODE],L[MAXNODE],R[MAXNODE];<BR></SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;S[MAXNODE],C[MAXNODE],ROW[MAXNODE];<BR></SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;n,m;<BR></SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;h&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">;</SPAN><SPAN 
      style="COLOR: #008000">//</SPAN><SPAN 
      style="COLOR: #008000">the&nbsp;Leftest&nbsp;and&nbsp;Upest&nbsp;node&nbsp;</SPAN><SPAN 
      style="COLOR: #008000"><BR></SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;a[LENGTH][LENGTH];<BR></SPAN><SPAN 
      style="COLOR: #0000ff">void</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;Init(){<BR>&nbsp;&nbsp;&nbsp;&nbsp;freopen(</SPAN><SPAN 
      style="COLOR: #000000">"</SPAN><SPAN 
      style="COLOR: #000000">sudoku.in</SPAN><SPAN 
      style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">r</SPAN><SPAN 
      style="COLOR: #000000">"</SPAN><SPAN 
      style="COLOR: #000000">,stdin);<BR>&nbsp;&nbsp;&nbsp;&nbsp;freopen(</SPAN><SPAN 
      style="COLOR: #000000">"</SPAN><SPAN 
      style="COLOR: #000000">sudoku.out</SPAN><SPAN 
      style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">w</SPAN><SPAN 
      style="COLOR: #000000">"</SPAN><SPAN 
      style="COLOR: #000000">,stdout);<BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">for</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;(</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;i&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">0</SPAN><SPAN 
      style="COLOR: #000000">;&nbsp;i</SPAN><SPAN 
      style="COLOR: #000000">&lt;</SPAN><SPAN 
      style="COLOR: #000000">LENGTH;&nbsp;i</SPAN><SPAN 
      style="COLOR: #000000">++</SPAN><SPAN 
      style="COLOR: #000000">)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">for</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;(</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;j&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">0</SPAN><SPAN 
      style="COLOR: #000000">;&nbsp;j</SPAN><SPAN 
      style="COLOR: #000000">&lt;</SPAN><SPAN 
      style="COLOR: #000000">LENGTH;&nbsp;j</SPAN><SPAN 
      style="COLOR: #000000">++</SPAN><SPAN 
      style="COLOR: #000000">)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scanf(</SPAN><SPAN 
      style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">%d</SPAN><SPAN 
      style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">&amp;</SPAN><SPAN 
      style="COLOR: #000000">a[i][j]);<BR>}<BR></SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;Row(</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;x,</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;y,</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;num){<BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">return</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;(x</SPAN><SPAN 
      style="COLOR: #000000">*</SPAN><SPAN 
      style="COLOR: #000000">LENGTH</SPAN><SPAN 
      style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">y)</SPAN><SPAN 
      style="COLOR: #000000">*</SPAN><SPAN 
      style="COLOR: #000000">LENGTH</SPAN><SPAN 
      style="COLOR: #000000">+</SPAN><SPAN 
      style="COLOR: #000000">num</SPAN><SPAN 
      style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN 
      style="COLOR: #000000">;<BR>}<BR><BR></SPAN><SPAN 
      style="COLOR: #0000ff">#define</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;SEC_POS&nbsp;0</SPAN><SPAN 
      style="COLOR: #000000"><BR></SPAN><SPAN 
      style="COLOR: #0000ff">#define</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;SEC_ROW&nbsp;1</SPAN><SPAN 
      style="COLOR: #000000"><BR></SPAN><SPAN 
      style="COLOR: #0000ff">#define</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;SEC_COL&nbsp;2</SPAN><SPAN 
      style="COLOR: #000000"><BR></SPAN><SPAN 
      style="COLOR: #0000ff">#define</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;SEC_SQR&nbsp;3</SPAN><SPAN 
      style="COLOR: #000000"><BR></SPAN><SPAN 
      style="COLOR: #0000ff">#define</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;PER_SEC&nbsp;LENGTH*LENGTH</SPAN><SPAN 
      style="COLOR: #000000"><BR><BR></SPAN><SPAN 
      style="COLOR: #0000ff">void</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;Fill(</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;x,</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;y,</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;num){<BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;row&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;Row(x,y,num);<BR>&nbsp;&nbsp;&nbsp;&nbsp;map[row][SEC_POS</SPAN><SPAN 
      style="COLOR: #000000">*</SPAN><SPAN 
      style="COLOR: #000000">PER_SEC</SPAN><SPAN 
      style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">x</SPAN><SPAN 
      style="COLOR: #000000">*</SPAN><SPAN 
      style="COLOR: #000000">LENGTH</SPAN><SPAN 
      style="COLOR: #000000">+</SPAN><SPAN 
      style="COLOR: #000000">y]&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">1</SPAN><SPAN 
      style="COLOR: #000000">;<BR>&nbsp;&nbsp;&nbsp;&nbsp;map[row][SEC_ROW</SPAN><SPAN 
      style="COLOR: #000000">*</SPAN><SPAN 
      style="COLOR: #000000">PER_SEC</SPAN><SPAN 
      style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">x</SPAN><SPAN 
      style="COLOR: #000000">*</SPAN><SPAN 
      style="COLOR: #000000">LENGTH</SPAN><SPAN 
      style="COLOR: #000000">+</SPAN><SPAN 
      style="COLOR: #000000">num</SPAN><SPAN 
      style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN 
      style="COLOR: #000000">]&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">1</SPAN><SPAN 
      style="COLOR: #000000">;<BR>&nbsp;&nbsp;&nbsp;&nbsp;map[row][SEC_COL</SPAN><SPAN 
      style="COLOR: #000000">*</SPAN><SPAN 
      style="COLOR: #000000">PER_SEC</SPAN><SPAN 
      style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">y</SPAN><SPAN 
      style="COLOR: #000000">*</SPAN><SPAN 
      style="COLOR: #000000">LENGTH</SPAN><SPAN 
      style="COLOR: #000000">+</SPAN><SPAN 
      style="COLOR: #000000">num</SPAN><SPAN 
      style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN 
      style="COLOR: #000000">]&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">1</SPAN><SPAN 
      style="COLOR: #000000">;<BR>&nbsp;&nbsp;&nbsp;&nbsp;map[row][SEC_SQR</SPAN><SPAN 
      style="COLOR: #000000">*</SPAN><SPAN 
      style="COLOR: #000000">PER_SEC</SPAN><SPAN 
      style="COLOR: #000000">+</SPAN><SPAN 
      style="COLOR: #000000">((x</SPAN><SPAN 
      style="COLOR: #000000">/</SPAN><SPAN 
      style="COLOR: #000000">SQRLEN)</SPAN><SPAN 
      style="COLOR: #000000">*</SPAN><SPAN 
      style="COLOR: #000000">SQRLEN</SPAN><SPAN 
      style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">(y</SPAN><SPAN 
      style="COLOR: #000000">/</SPAN><SPAN 
      style="COLOR: #000000">SQRLEN))</SPAN><SPAN 
      style="COLOR: #000000">*</SPAN><SPAN 
      style="COLOR: #000000">LENGTH</SPAN><SPAN 
      style="COLOR: #000000">+</SPAN><SPAN 
      style="COLOR: #000000">num</SPAN><SPAN 
      style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN 
      style="COLOR: #000000">]&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">1</SPAN><SPAN 
      style="COLOR: #000000">;<BR>}<BR></SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;cnt;<BR></SPAN><SPAN 
      style="COLOR: #0000ff">void</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;BuildGraph(){<BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #008000">//</SPAN><SPAN 
      style="COLOR: #008000">&nbsp;Build&nbsp;The&nbsp;0-1&nbsp;Matrix</SPAN><SPAN 
      style="COLOR: #008000"><BR></SPAN><SPAN 
      style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">for</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;(</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;i&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">0</SPAN><SPAN 
      style="COLOR: #000000">;&nbsp;i</SPAN><SPAN 
      style="COLOR: #000000">&lt;</SPAN><SPAN 
      style="COLOR: #000000">LENGTH;&nbsp;i</SPAN><SPAN 
      style="COLOR: #000000">++</SPAN><SPAN 
      style="COLOR: #000000">)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">for</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;(</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;j&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">0</SPAN><SPAN 
      style="COLOR: #000000">;&nbsp;j</SPAN><SPAN 
      style="COLOR: #000000">&lt;</SPAN><SPAN 
      style="COLOR: #000000">LENGTH;&nbsp;j</SPAN><SPAN 
      style="COLOR: #000000">++</SPAN><SPAN 
      style="COLOR: #000000">)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">if</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;(a[i][j])<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fill(i,j,a[i][j]);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">else</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">for</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;(</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;k&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">1</SPAN><SPAN 
      style="COLOR: #000000">;&nbsp;k</SPAN><SPAN 
      style="COLOR: #000000">&lt;=</SPAN><SPAN 
      style="COLOR: #000000">LENGTH;&nbsp;k</SPAN><SPAN 
      style="COLOR: #000000">++</SPAN><SPAN 
      style="COLOR: #000000">)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fill(i,j,k);<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #008000">//</SPAN><SPAN 
      style="COLOR: #008000">&nbsp;Build&nbsp;Dacing&nbsp;Links</SPAN><SPAN 
      style="COLOR: #008000"><BR></SPAN><SPAN 
      style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;n&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;MAXN,m&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;MAXM;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">for</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;(</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;i&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">0</SPAN><SPAN 
      style="COLOR: #000000">;&nbsp;i</SPAN><SPAN 
      style="COLOR: #000000">&lt;</SPAN><SPAN 
      style="COLOR: #000000">n;&nbsp;i</SPAN><SPAN 
      style="COLOR: #000000">++</SPAN><SPAN 
      style="COLOR: #000000">)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">for</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;(</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;j&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">0</SPAN><SPAN 
      style="COLOR: #000000">;&nbsp;j</SPAN><SPAN 
      style="COLOR: #000000">&lt;</SPAN><SPAN 
      style="COLOR: #000000">m;&nbsp;j</SPAN><SPAN 
      style="COLOR: #000000">++</SPAN><SPAN 
      style="COLOR: #000000">)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">if</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;(map[i][j])<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;map[i][j]&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">++</SPAN><SPAN 
      style="COLOR: #000000">cnt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;tmp,s&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">0</SPAN><SPAN 
      style="COLOR: #000000">,t&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">0</SPAN><SPAN 
      style="COLOR: #000000">;<BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">for</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;(</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;i&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">0</SPAN><SPAN 
      style="COLOR: #000000">;&nbsp;i</SPAN><SPAN 
      style="COLOR: #000000">&lt;</SPAN><SPAN 
      style="COLOR: #000000">n;&nbsp;i</SPAN><SPAN 
      style="COLOR: #000000">++</SPAN><SPAN 
      style="COLOR: #000000">){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">for</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;(</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;j&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">0</SPAN><SPAN 
      style="COLOR: #000000">;&nbsp;j</SPAN><SPAN 
      style="COLOR: #000000">&lt;</SPAN><SPAN 
      style="COLOR: #000000">m;&nbsp;j</SPAN><SPAN 
      style="COLOR: #000000">++</SPAN><SPAN 
      style="COLOR: #000000">)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">if</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;(tmp</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">map[i][j])<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;L[tmp]&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;t,&nbsp;S[tmp]&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;i,t&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;tmp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">for</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;(</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;j&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;m</SPAN><SPAN 
      style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN 
      style="COLOR: #000000">;&nbsp;j</SPAN><SPAN 
      style="COLOR: #000000">&gt;=</SPAN><SPAN 
      style="COLOR: #000000">0</SPAN><SPAN 
      style="COLOR: #000000">;&nbsp;j</SPAN><SPAN 
      style="COLOR: #000000">--</SPAN><SPAN 
      style="COLOR: #000000">)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">if</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;(tmp</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">map[i][j])<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;R[tmp]&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;s,&nbsp;s&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">tmp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;R[t]&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;s,L[s]&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;t;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">for</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;(</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;j&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">0</SPAN><SPAN 
      style="COLOR: #000000">;&nbsp;j</SPAN><SPAN 
      style="COLOR: #000000">&lt;</SPAN><SPAN 
      style="COLOR: #000000">m;&nbsp;j</SPAN><SPAN 
      style="COLOR: #000000">++</SPAN><SPAN 
      style="COLOR: #000000">){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">++</SPAN><SPAN 
      style="COLOR: #000000">cnt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">for</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;(</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;i&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">0</SPAN><SPAN 
      style="COLOR: #000000">;&nbsp;i</SPAN><SPAN 
      style="COLOR: #000000">&lt;</SPAN><SPAN 
      style="COLOR: #000000">n;&nbsp;i</SPAN><SPAN 
      style="COLOR: #000000">++</SPAN><SPAN 
      style="COLOR: #000000">)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">if</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;(tmp</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">map[i][j])<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;U[tmp]&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;t,&nbsp;t&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;tmp,C[tmp]&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;cnt,&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">++</SPAN><SPAN 
      style="COLOR: #000000">S[cnt];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;cnt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">for</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;(</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;i&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;n</SPAN><SPAN 
      style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN 
      style="COLOR: #000000">;&nbsp;i</SPAN><SPAN 
      style="COLOR: #000000">&gt;=</SPAN><SPAN 
      style="COLOR: #000000">0</SPAN><SPAN 
      style="COLOR: #000000">;&nbsp;i</SPAN><SPAN 
      style="COLOR: #000000">--</SPAN><SPAN 
      style="COLOR: #000000">)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">if</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;(tmp</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">map[i][j])<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;D[tmp]&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;s,&nbsp;s&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;tmp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;D[cnt]&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;s,U[cnt]&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;t;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">for</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;(</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;i&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;cnt</SPAN><SPAN 
      style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">m</SPAN><SPAN 
      style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN 
      style="COLOR: #000000">;&nbsp;i</SPAN><SPAN 
      style="COLOR: #000000">&lt;=</SPAN><SPAN 
      style="COLOR: #000000">cnt;&nbsp;i</SPAN><SPAN 
      style="COLOR: #000000">++</SPAN><SPAN 
      style="COLOR: #000000">)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;L[i]&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;i</SPAN><SPAN 
      style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN 
      style="COLOR: #000000">;<BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">for</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;(</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;i&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;cnt;&nbsp;i</SPAN><SPAN 
      style="COLOR: #000000">&gt;</SPAN><SPAN 
      style="COLOR: #000000">cnt</SPAN><SPAN 
      style="COLOR: #000000">-</SPAN><SPAN 
      style="COLOR: #000000">m;&nbsp;i</SPAN><SPAN 
      style="COLOR: #000000">--</SPAN><SPAN 
      style="COLOR: #000000">)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;R[i]&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;i</SPAN><SPAN 
      style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN 
      style="COLOR: #000000">;<BR>&nbsp;&nbsp;&nbsp;&nbsp;R[h]&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;cnt</SPAN><SPAN 
      style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">m</SPAN><SPAN 
      style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN 
      style="COLOR: #000000">,L[h]&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;cnt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;L[cnt</SPAN><SPAN 
      style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">m</SPAN><SPAN 
      style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN 
      style="COLOR: #000000">]&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;R[cnt]&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;h;<BR>}<BR></SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;ans[MAXM</SPAN><SPAN 
      style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN 
      style="COLOR: #000000">];<BR></SPAN><SPAN 
      style="COLOR: #0000ff">void</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;Cover(</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;c){<BR>&nbsp;&nbsp;&nbsp;&nbsp;L[R[c]]&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;L[c],R[L[c]]&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;R[c];<BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">for</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;(</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;i&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;D[c];i</SPAN><SPAN 
      style="COLOR: #000000">!=</SPAN><SPAN 
      style="COLOR: #000000">c;i&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;D[i])<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">for</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;(</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;j&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;R[i];j</SPAN><SPAN 
      style="COLOR: #000000">!=</SPAN><SPAN 
      style="COLOR: #000000">i;j&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;R[j])<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;U[D[j]]&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;U[j],D[U[j]]&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;D[j],S[C[j]]</SPAN><SPAN 
      style="COLOR: #000000">--</SPAN><SPAN 
      style="COLOR: #000000">;<BR>}<BR></SPAN><SPAN 
      style="COLOR: #0000ff">void</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;UnCover(</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;c){<BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">for</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;(</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;i&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;U[c];i</SPAN><SPAN 
      style="COLOR: #000000">!=</SPAN><SPAN 
      style="COLOR: #000000">c;i</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">U[i])<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">for</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;(</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;j&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;L[i];j</SPAN><SPAN 
      style="COLOR: #000000">!=</SPAN><SPAN 
      style="COLOR: #000000">i;j&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;L[j])<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;S[C[j]]</SPAN><SPAN 
      style="COLOR: #000000">++</SPAN><SPAN 
      style="COLOR: #000000">,U[D[j]]&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;D[U[j]]&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;j;<BR>&nbsp;&nbsp;&nbsp;&nbsp;L[R[c]]&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;R[L[c]]&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;c;<BR>}<BR></SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;Ans&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN 
      style="COLOR: #000000">;<BR></SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;ScoreTable[LENGTH][LENGTH]&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;{</SPAN><SPAN 
      style="COLOR: #000000">6</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">6</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">6</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">6</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">6</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">6</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">6</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">6</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">6</SPAN><SPAN 
      style="COLOR: #000000">},<BR>&nbsp;&nbsp;&nbsp;&nbsp;{</SPAN><SPAN 
      style="COLOR: #000000">6</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">7</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">7</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">7</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">7</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">7</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">7</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">7</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">6</SPAN><SPAN 
      style="COLOR: #000000">},<BR>&nbsp;&nbsp;&nbsp;&nbsp;{</SPAN><SPAN 
      style="COLOR: #000000">6</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">7</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">8</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">8</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">8</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">8</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">8</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">7</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">6</SPAN><SPAN 
      style="COLOR: #000000">},<BR>&nbsp;&nbsp;&nbsp;&nbsp;{</SPAN><SPAN 
      style="COLOR: #000000">6</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">7</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">8</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">9</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">9</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">9</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">8</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">7</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">6</SPAN><SPAN 
      style="COLOR: #000000">},<BR>&nbsp;&nbsp;&nbsp;&nbsp;{</SPAN><SPAN 
      style="COLOR: #000000">6</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">7</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">8</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">9</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">10</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">9</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">8</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">7</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">6</SPAN><SPAN 
      style="COLOR: #000000">},<BR>&nbsp;&nbsp;&nbsp;&nbsp;{</SPAN><SPAN 
      style="COLOR: #000000">6</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">7</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">8</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">9</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">9</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">9</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">8</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">7</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">6</SPAN><SPAN 
      style="COLOR: #000000">},<BR>&nbsp;&nbsp;&nbsp;&nbsp;{</SPAN><SPAN 
      style="COLOR: #000000">6</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">7</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">8</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">8</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">8</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">8</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">8</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">7</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">6</SPAN><SPAN 
      style="COLOR: #000000">},<BR>&nbsp;&nbsp;&nbsp;&nbsp;{</SPAN><SPAN 
      style="COLOR: #000000">6</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">7</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">7</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">7</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">7</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">7</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">7</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">7</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">6</SPAN><SPAN 
      style="COLOR: #000000">},<BR>&nbsp;&nbsp;&nbsp;&nbsp;{</SPAN><SPAN 
      style="COLOR: #000000">6</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">6</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">6</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">6</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">6</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">6</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">6</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">6</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">6</SPAN><SPAN 
      style="COLOR: #000000">}<BR>};<BR></SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;score(</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;c){<BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;t&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;S[c];<BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;num&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;t</SPAN><SPAN 
      style="COLOR: #000000">%</SPAN><SPAN 
      style="COLOR: #000000">LENGTH</SPAN><SPAN 
      style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN 
      style="COLOR: #000000">;<BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;x&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;t</SPAN><SPAN 
      style="COLOR: #000000">/</SPAN><SPAN 
      style="COLOR: #000000">LENGTH</SPAN><SPAN 
      style="COLOR: #000000">/</SPAN><SPAN 
      style="COLOR: #000000">LENGTH</SPAN><SPAN 
      style="COLOR: #000000">%</SPAN><SPAN 
      style="COLOR: #000000">LENGTH;<BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;y&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;t</SPAN><SPAN 
      style="COLOR: #000000">/</SPAN><SPAN 
      style="COLOR: #000000">LENGTH</SPAN><SPAN 
      style="COLOR: #000000">%</SPAN><SPAN 
      style="COLOR: #000000">LENGTH;<BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">return</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;num</SPAN><SPAN 
      style="COLOR: #000000">*</SPAN><SPAN 
      style="COLOR: #000000">ScoreTable[x][y];<BR>}<BR></SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;ansmap[LENGTH][LENGTH];<BR></SPAN><SPAN 
      style="COLOR: #008000">//</SPAN><SPAN 
      style="COLOR: #008000">this&nbsp;function&nbsp;is&nbsp;not&nbsp;used&nbsp;in&nbsp;this&nbsp;program,&nbsp;but&nbsp;it&nbsp;gives&nbsp;out&nbsp;an&nbsp;solution&nbsp;of&nbsp;a&nbsp;sudoku</SPAN><SPAN 
      style="COLOR: #008000"><BR></SPAN><SPAN 
      style="COLOR: #0000ff">void</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;GetAns(</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;step){<BR>&nbsp;&nbsp;&nbsp;&nbsp;memset(ansmap,</SPAN><SPAN 
      style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #0000ff">sizeof</SPAN><SPAN 
      style="COLOR: #000000">(ansmap));<BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">for</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;(</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;i&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">0</SPAN><SPAN 
      style="COLOR: #000000">;&nbsp;i</SPAN><SPAN 
      style="COLOR: #000000">&lt;</SPAN><SPAN 
      style="COLOR: #000000">step;&nbsp;i</SPAN><SPAN 
      style="COLOR: #000000">++</SPAN><SPAN 
      style="COLOR: #000000">){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;t&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;ans[i];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;x&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;t</SPAN><SPAN 
      style="COLOR: #000000">/</SPAN><SPAN 
      style="COLOR: #000000">LENGTH</SPAN><SPAN 
      style="COLOR: #000000">/</SPAN><SPAN 
      style="COLOR: #000000">LENGTH</SPAN><SPAN 
      style="COLOR: #000000">%</SPAN><SPAN 
      style="COLOR: #000000">LENGTH;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;y&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;t</SPAN><SPAN 
      style="COLOR: #000000">/</SPAN><SPAN 
      style="COLOR: #000000">LENGTH</SPAN><SPAN 
      style="COLOR: #000000">%</SPAN><SPAN 
      style="COLOR: #000000">LENGTH;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;num&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;t</SPAN><SPAN 
      style="COLOR: #000000">%</SPAN><SPAN 
      style="COLOR: #000000">LENGTH</SPAN><SPAN 
      style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN 
      style="COLOR: #000000">;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ansmap[x][y]&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;num;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>}<BR></SPAN><SPAN 
      style="COLOR: #0000ff">void</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;search(</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;step,</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;v){<BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">if</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;(R[h]&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">==</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;h){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ans&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;max(Ans,v);<BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #008000">/*</SPAN><SPAN 
      style="COLOR: #008000">&nbsp;&nbsp;&nbsp;&nbsp;GetAns(step);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;(int&nbsp;i&nbsp;=&nbsp;0;&nbsp;i&lt;LENGTH;&nbsp;i++){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;(int&nbsp;j&nbsp;=&nbsp;0;&nbsp;j&lt;LENGTH;&nbsp;j++)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("%d&nbsp;",ansmap[i][j]);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("\n");</SPAN><SPAN 
      style="COLOR: #008000">*/</SPAN><SPAN 
      style="COLOR: #000000"><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">return</SPAN><SPAN 
      style="COLOR: #000000">;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;c,s&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;MAXNODE;<BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">for</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;(</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;i&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;R[h];i</SPAN><SPAN 
      style="COLOR: #000000">!=</SPAN><SPAN 
      style="COLOR: #000000">h;&nbsp;i</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">R[i])<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">if</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;(S[i]</SPAN><SPAN 
      style="COLOR: #000000">&lt;</SPAN><SPAN 
      style="COLOR: #000000">s)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;S[i],c&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;i;<BR>&nbsp;&nbsp;&nbsp;&nbsp;Cover(c);<BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">for</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;(</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;i&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;D[c];i</SPAN><SPAN 
      style="COLOR: #000000">!=</SPAN><SPAN 
      style="COLOR: #000000">c;i</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">D[i]){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ans[step]&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;S[i];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">for</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;(</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;j&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;R[i];j</SPAN><SPAN 
      style="COLOR: #000000">!=</SPAN><SPAN 
      style="COLOR: #000000">i;j&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;R[j])<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Cover(C[j]);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;search(step</SPAN><SPAN 
      style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN 
      style="COLOR: #000000">,v</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN 
      style="COLOR: #000000">score(i));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">for</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;(</SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;j&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;L[i];j</SPAN><SPAN 
      style="COLOR: #000000">!=</SPAN><SPAN 
      style="COLOR: #000000">i;j&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">=</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;L[j])<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;UnCover(C[j]);<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;UnCover(c);<BR>}<BR></SPAN><SPAN 
      style="COLOR: #0000ff">void</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;DancingLinks(){<BR>&nbsp;&nbsp;&nbsp;&nbsp;search(</SPAN><SPAN 
      style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
      style="COLOR: #000000">0</SPAN><SPAN 
      style="COLOR: #000000">);<BR>&nbsp;&nbsp;&nbsp;&nbsp;printf(</SPAN><SPAN 
      style="COLOR: #000000">"</SPAN><SPAN 
      style="COLOR: #000000">%d\n</SPAN><SPAN 
      style="COLOR: #000000">"</SPAN><SPAN 
      style="COLOR: #000000">,Ans);<BR>}<BR></SPAN><SPAN 
      style="COLOR: #0000ff">void</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;Solve(){<BR>&nbsp;&nbsp;&nbsp;&nbsp;BuildGraph();<BR>&nbsp;&nbsp;&nbsp;&nbsp;DancingLinks();<BR>}<BR></SPAN><SPAN 
      style="COLOR: #0000ff">int</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;main(){<BR>&nbsp;&nbsp;&nbsp;&nbsp;Init();<BR>&nbsp;&nbsp;&nbsp;&nbsp;Solve();<BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN 
      style="COLOR: #0000ff">return</SPAN><SPAN 
      style="COLOR: #000000">&nbsp;</SPAN><SPAN 
      style="COLOR: #000000">0</SPAN><SPAN 
      style="COLOR: #000000">;<BR>}<BR></SPAN></DIV><BR>
      <DIV class=itemdesc>posted on 2009-11-30 21:52 <A 
      href="http://www.cppblog.com/zxytim/">TimTopCoder</A> 阅读(1009) <A 
      href="http://www.cppblog.com/zxytim/archive/2009/11/30/102302.html#Post">评论(1)</A> 
      &nbsp;<A 
      href="http://www.cppblog.com/zxytim/admin/EditPosts.aspx?postid=102302">编辑</A>&nbsp;<A 
      href="http://www.cppblog.com/zxytim/AddToFavorite.aspx?id=102302">收藏</A> 
      <A 
      href="http://www.cppblog.com/zxytim/services/trackbacks/102302.aspx">引用</A> 
      </DIV></DIV><IMG height=1 
      src="Sudoku - DancingLinks （数独DancingLinks搜索优化算法） - Tim's Programming Space - C++博客.files/102302.jpg" 
      width=1> <!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
<rdf:Description
rdf:about="http://www.cppblog.com/zxytim/archive/2009/11/30/102302.html"
dc:identifier="http://www.cppblog.com/zxytim/archive/2009/11/30/102302.html"
dc:title="Sudoku - DancingLinks （数独DancingLinks搜索优化算法）"
trackback:ping="http://www.cppblog.com/zxytim/services/trackbacks/102302.aspx" />
</rdf:RDF>
-->
      <SCRIPT type=text/javascript>
//<![CDATA[
Sys.WebForms.PageRequestManager._initialize('AjaxHolder$scriptmanager1', document.getElementById('Form1'));
Sys.WebForms.PageRequestManager.getInstance()._updateControls(['tAjaxHolder$UpdatePanel1'], [], [], 90);
//]]>
</SCRIPT>

      <DIV id=AjaxHolder_UpdatePanel1><A name=pagedcomment></A>评论: 
      <DIV class=moreinfo>
      <UL class=morelist>
        <LI class=morelistitem>
        <DIV class=moreinfotitle><A 
        title="permalink: re: Sudoku - DancingLinks （数独DancingLinks搜索优化算法）" 
        href="http://www.cppblog.com/zxytim/archive/2009/11/30/102302.html#102340">#</A>&nbsp;<A 
        name=102340></A>re: Sudoku - DancingLinks （数独DancingLinks搜索优化算法）<A 
        name=Post></A>&nbsp;&nbsp;<A 
        id=AjaxHolder_Comments_CommentList_ctl01_NameLink 
        href="http://www.cypfj.com/" target=_blank>创意产品批发</A> Posted @ 
        2009-12-01 15:22 </DIV>学习了。谢谢！&nbsp;&nbsp;<A 
        onclick='return SetReplyAuhor("创意产品批发")' 
        href="http://www.cppblog.com/zxytim/archive/2009/11/30/102302.html#post">回复</A>&nbsp;&nbsp;<A 
        title=查看该作者发表过的评论 
        href="http://www.cppblog.com/comment?author=%e5%88%9b%e6%84%8f%e4%ba%a7%e5%93%81%e6%89%b9%e5%8f%91" 
        target=_blank>更多评论</A> <A 
        id=AjaxHolder_Comments_CommentList_ctl01_DeleteLink 
        href="javascript:__doPostBack('AjaxHolder$Comments$CommentList$ctl01$DeleteLink','')"></A>&nbsp;&nbsp;<A 
        id=AjaxHolder_Comments_CommentList_ctl01_EditLink></A><BR><BR></LI></UL></DIV>
      <DIV id=AjaxHolder_Comments_divRefreshComments 
      style="FONT-SIZE: 12px; MARGIN-BOTTOM: 5px; MARGIN-RIGHT: 10px; TEXT-ALIGN: right"><A 
      id=AjaxHolder_Comments_refreshList 
      href="javascript:__doPostBack('AjaxHolder$Comments$refreshList','')">刷新评论列表</A></DIV>
      <STYLE>TD {
	FONT-SIZE: 12px
}
.commentTextBox {
	FONT-SIZE: 13px; FONT-FAMILY: Verdana
}
</STYLE>
<!--Beging Temp Save-->
      <STYLE>.userData {
	BEHAVIOR: url(#default#userdata)
}
</STYLE>

      <DIV class=userData id=CommentsPersistDiv></DIV>
      <SCRIPT type=text/javascript>
function pageLoad()
{
    Sys.WebForms.PageRequestManager.getInstance().add_initializeRequest(handleInitializeRequest);
    //Sys.WebForms.PageRequestManager.getInstance().add_endRequest(handleEndRequest);
}

function handleInitializeRequest(sender, args)
{
    var prm = Sys.WebForms.PageRequestManager.getInstance();
    var eid = args.get_postBackElement().id;
    if (eid.indexOf("DeleteLink")>0) 
    {
       args.get_postBackElement().innerHTML = "<font color='red'>正在删除...</font>";         
    }    
    if (eid.indexOf("btnSubmit")>0) 
    {
       document.getElementById("AjaxHolder_PostComment_ltSubmitMsg").innerHTML="正在提交...";
       document.getElementById("AjaxHolder_PostComment_btnSubmit").disabled = true;
       
    }    
   
}	

function TempSave(ElementID)
{
	try
	{
	CommentsPersistDiv.setAttribute("CommentContent",document.getElementById(ElementID).value);
	CommentsPersistDiv.save("CommentXMLStore");
	}
	catch(ex)
	{
	}
	
}
function Restore(ElementID)
{
	CommentsPersistDiv.load("CommentXMLStore");
	document.getElementById(ElementID).value=CommentsPersistDiv.getAttribute("CommentContent");
}	
			
			
</SCRIPT>
<!--Ene TempSave-->
      <DIV class=commentform>
      <SCRIPT 
      src="Sudoku - DancingLinks （数独DancingLinks搜索优化算法） - Tim's Programming Space - C++博客.files/google_service.js" 
      type=text/javascript>
</SCRIPT>

      <SCRIPT type=text/javascript>
try{
  GS_googleAddAdSenseService("ca-pub-4210569241504288");
  GS_googleEnableAllServices();
  } catch (e) { }
</SCRIPT>

      <SCRIPT type=text/javascript>
try{
  GA_googleAddSlot("ca-pub-4210569241504288", "cppblog_blogpost_bottom");
  GA_googleAddSlot("ca-pub-4210569241504288", "cppblog_commentbox_up");
  } catch (e) { }
</SCRIPT>

      <SCRIPT type=text/javascript>
try{
  GA_googleFetchAds();
  } catch (e) { }
</SCRIPT>
      <SPAN id=AjaxHolder_PostComment_ltSubmitMsg 
      style="COLOR: red"></SPAN><BR><A name=Feedback></A>
      <TABLE cellSpacing=1 cellPadding=1 border=0>
        <TBODY>
        <TR>
          <TD colSpan=3 height=5></TD></TR>
        <TR>
          <TD width=75></TD>
          <TD></TD>
          <TD></TD></TR>
        <TR>
          <TD></TD>
          <TD colSpan=2><A href="http://www.cnblogs.com/" 
            target=_blank>博客园首页</A>&nbsp; <A href="http://news.cnblogs.com/" 
            target=_blank>IT新闻</A>&nbsp; <A href="http://home.cnblogs.com/ing/" 
            target=_blank>程序员微博</A>&nbsp; <A 
            href="http://job.cnblogs.com/cate-cpp_programmer/" 
            target=_blank>C++程序员招聘</A> </TD></TR>
        <TR>
          <TD width=55>标题</TD>
          <TD><INPUT class=commenttb id=AjaxHolder_PostComment_tbTitle 
            style="WIDTH: 320px" 
            value="re: Sudoku - DancingLinks （数独DancingLinks搜索优化算法）" 
            name=AjaxHolder$PostComment$tbTitle></TD>
          <TD><SPAN id=AjaxHolder_PostComment_RequiredFieldValidator1 
            style="VISIBILITY: hidden; COLOR: red">请输入标题</SPAN></TD></TR>
        <TR>
          <TD>姓名</TD>
          <TD><INPUT class=commenttb id=AjaxHolder_PostComment_tbName 
            style="WIDTH: 320px" name=AjaxHolder$PostComment$tbName></TD>
          <TD><SPAN id=AjaxHolder_PostComment_RequiredFieldValidator2 
            style="VISIBILITY: hidden; COLOR: red">请输入你的姓名</SPAN></TD></TR>
        <TR>
          <TD>主页</TD>
          <TD><INPUT class=commenttb id=AjaxHolder_PostComment_tbUrl 
            style="WIDTH: 320px" name=AjaxHolder$PostComment$tbUrl></TD>
          <TD><FONT face=宋体></FONT></TD></TR>
        <TR>
          <TD align=left colSpan=3>
            <TABLE class=CommentForm id=AjaxHolder_PostComment_tbCaptchaImage 
            cellSpacing=0 cellPadding=0 border=0>
              <TBODY>
              <TR>
                <TD colSpan=3><SPAN 
                  id=AjaxHolder_PostComment_Requiredfieldvalidator4 
                  style="DISPLAY: none; COLOR: red">请输入验证码</SPAN> <SPAN 
                  id=AjaxHolder_PostComment_lblImage 
                  style="FONT-WEIGHT: bold; COLOR: red"></SPAN></TD></TR>
              <TR>
                <TD width=78>验证码</TD>
                <TD><INPUT id=AjaxHolder_PostComment_CodeNumberTextBox 
                  name=AjaxHolder$PostComment$CodeNumberTextBox>*</TD>
                <TD align=left><IMG id=AjaxHolder_PostComment_Img1 
                  src="Sudoku - DancingLinks （数独DancingLinks搜索优化算法） - Tim's Programming Space - C++博客.files/JpegImage.jpg"> 
                </TD></TR></TBODY></TABLE></TD></TR>
        <TR>
          <TD colSpan=3>内容(提交失败后,可以通过“恢复上次提交”恢复刚刚提交的内容) <SPAN 
            id=AjaxHolder_PostComment_RequiredFieldValidator3 
            style="VISIBILITY: hidden; COLOR: red">请输入评论内容</SPAN><BR><TEXTAREA class=commentTextBox id=AjaxHolder_PostComment_tbComment onkeydown="ctlent(event,'AjaxHolder_PostComment_tbComment')" style="WIDTH: 480px; HEIGHT: 220px" name=AjaxHolder$PostComment$tbComment rows=10 cols=50></TEXTAREA></TD></TR>
        <TR>
          <TD colSpan=3><SPAN id=AjaxHolder_PostComment_Message 
            style="COLOR: red"></SPAN></TD>
        <TR>
          <TD colSpan=3><INPUT id=AjaxHolder_PostComment_chkRemember 
            tabIndex=-1 type=checkbox CHECKED 
            name=AjaxHolder$PostComment$chkRemember><LABEL 
            for=AjaxHolder_PostComment_chkRemember>Remember Me?</LABEL></TD></TR>
        <TR>
          <TD height=23><INPUT id=AjaxHolder_PostComment_btnSubmit onclick="TempSave('AjaxHolder_PostComment_tbComment');WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;AjaxHolder$PostComment$btnSubmit&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" type=submit value=提交 name=AjaxHolder$PostComment$btnSubmit> 
          </TD>
          <TD colSpan=2 height=23>&nbsp; <A id=AjaxHolder_PostComment_lnkLogin 
            href="http://www.cppblog.com/login.aspx?ReturnURL=http://www.cppblog.com/zxytim/archive/2009/11/30/102302.html&amp;SourceURL=/zxytim/archive/2009/11/30/102302.html">登录</A>&nbsp;&nbsp;<A 
            id=AjaxHolder_PostComment_linkLoginComment 
            onclick="if(document.getElementById('AjaxHolder_PostComment_tbComment').value != '') return confirm('未提交的评论内容将会丢失, 你真的要进入高级评论吗?');" 
            href="http://www.cppblog.com/zxytim/archive/2009/11/30/102302.html?login=1#Post">使用高级评论</A>&nbsp;&nbsp;<A 
            href="http://www.cppblog.com/RequireRegister.aspx">新用户注册</A>&nbsp;&nbsp;<A 
            href="http://www.cppblog.com/zxytim/archive/2009/11/30/102302.html#Top">返回页首</A>&nbsp;&nbsp;<A 
            id=AjaxHolder_PostComment_lbRestore 
            onclick="Restore('AjaxHolder_PostComment_tbComment'); return false;" 
            href="http://www.cppblog.com/zxytim/archive/2009/11/30/102302.html#Post">恢复上次提交</A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
          </TD></TR>
        <TR>
          <TD colSpan=3>[使用Ctrl+Enter键可以直接提交]</TD></TR>
        <TR>
          <TD colSpan=3><A href="http://kb.cnblogs.com/zt/windows7/" 
            target=_blank>Windows 7专题</A></TD></TR>
        <TR>
          <TD colSpan=3>
            <DIV class=other_info_list id=itnews_block 
            style="LINE-HEIGHT: 180%">IT新闻：<BR>· <A 
            href="http://news.cnblogs.com/n/54010/" 
            target=_blank>九城发公开信挖角腾讯用户：玩不爽两亿Q币补偿</A><BR>· <A 
            href="http://news.cnblogs.com/n/54009/" 
            target=_blank>MyLatch：社交化的求职网站</A><BR>· <A 
            href="http://news.cnblogs.com/n/54007/" 
            target=_blank>报刊出版业的十大数字化迷局</A><BR>· <A 
            href="http://news.cnblogs.com/n/54004/" target=_blank>三款淘宝手机问世 
            淘宝无线电子商务开启</A><BR>· <A href="http://news.cnblogs.com/n/54003/" 
            target=_blank>德国工程师称破解GSM加密算法 影响80%手机安全</A><BR></DIV>
            <DIV class=other_info_list id=cnblogs_posts 
            style="LINE-HEIGHT: 180%">博客园首页随笔：<BR>· <A 
            href="http://www.cnblogs.com/YinWangLive/archive/2009/12/30/1635776.html" 
            target=_blank>请享受与技术相爱的过程</A><BR>· <A 
            href="http://www.cnblogs.com/DotNetNuke/archive/2009/12/30/1635758.html" 
            target=_blank>ASP.NET SQL 注入免费解决方案</A><BR>· <A 
            href="http://www.cnblogs.com/legendxian/archive/2009/12/30/1635718.html" 
            target=_blank>Asp.Net大型项目实践-关键技术方案选择理由及思路</A><BR>· <A 
            href="http://www.cnblogs.com/jujusharp/archive/2009/12/30/c-sharp-dynamic.html" 
            target=_blank>.NET 4.0 新特性-dynamic</A><BR>· <A 
            href="http://www.cnblogs.com/n216/archive/2009/12/30/1635669.html" 
            target=_blank>《漫谈程序的效率和水平（二）》（2009/12/28）</A><BR></DIV>
            <DIV class=other_info_list id=job_block 
            style="LINE-HEIGHT: 180%">招聘信息：<BR>· <A 
            href="http://job.cnblogs.com/offer/4558/" 
            target=_blank>客户端应用软件开发工程师(边锋网络游戏)</A><BR>· <A 
            href="http://job.cnblogs.com/offer/3699/" 
            target=_blank>网站程序开发(济南容宽商贸有限公)</A><BR>· <A 
            href="http://job.cnblogs.com/offer/2630/" 
            target=_blank>C#开发工程师(诺亚舟教育科技（深圳）有限公司)</A><BR>· <A 
            href="http://job.cnblogs.com/offer/4274/" 
            target=_blank>网页设计师(一听音乐网)</A><BR>· <A 
            href="http://job.cnblogs.com/offer/3091/" target=_blank>VS.NET2008 
            C#WinForm开发系统工程师(南京惠施系统工程有限公司)</A><BR></DIV></TD></TR>
        <TR>
          <TD colSpan=3>
            <SCRIPT type=text/javascript>
		try{
		  GA_googleFillSlot("cppblog_blogpost_bottom");
		  } catch (e) { }
		</SCRIPT>
          </TD></TR>
        <TR>
          <TD colSpan=3 height=5></TD></TR>
        <TR>
          <TD colSpan=3></TD></TR>
        <TR>
          <TD colSpan=3 height=1>网站导航:
            <DIV id=blogsite><A 
            href="http://www.cnblogs.com/">博客园</A>&nbsp;&nbsp; <A 
            href="http://news.cnblogs.com/">IT新闻</A>&nbsp;&nbsp; <A 
            href="http://home.cnblogs.com/">博客园个人主页</A>&nbsp;&nbsp; <A 
            href="http://www.blogjava.net/">BlogJava</A>&nbsp;&nbsp; <A 
            href="http://www.cnweblog.com/">博客生活</A>&nbsp;&nbsp; <A 
            href="http://www.cnitblog.com/">IT博客网</A>&nbsp;&nbsp; <A 
            href="http://www.phpweblog.net/">PHP博客</A>&nbsp;&nbsp; <A 
            href="http://space.cnblogs.com/">博客园社区</A>&nbsp;&nbsp; <A 
            href="http://www.cppblog.com/zxytim/archive/2009/11/30/102302.html?opt=admin">管理</A> 
            </DIV></TD></TR>
        <TR>
          <TD colSpan=3><BR>在知识库中查看：<BR><A 
            href="http://kb.cnblogs.com/c/102302/">Sudoku - DancingLinks 
            （数独DancingLinks搜索优化算法）</A> <BR></TD></TR></TBODY></TABLE></DIV>
      <DIV id=AjaxHolder_PostComment_ValidationSummary1 
      style="DISPLAY: none; COLOR: red"></DIV></DIV>
      <DIV class=spacer>&nbsp;</DIV></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=2 width="97%" align=center border=0>
  <TBODY>
  <TR>
    <TD align=middle colSpan=2><A href="http://www.cnblogs.com/"><IMG 
      src="Sudoku - DancingLinks （数独DancingLinks搜索优化算法） - Tim's Programming Space - C++博客.files/footer.gif" 
      border=0></A></TD></TR>
  <TR>
    <TD align=right width="45%">Copyright © TimTopCoder</TD>
    <TD align=left>Powered by: <A href="http://www.cnblogs.com/">博客园</A> 
      模板提供：<A href="http://blog.hjenglish.com/">沪江博客</A> 
</TD></TR></TBODY></TABLE></DIV>
<SCRIPT type=text/javascript>
//<![CDATA[
var Page_ValidationSummaries =  new Array(document.getElementById("AjaxHolder_PostComment_ValidationSummary1"));
var Page_Validators =  new Array(document.getElementById("AjaxHolder_PostComment_RequiredFieldValidator1"), document.getElementById("AjaxHolder_PostComment_RequiredFieldValidator2"), document.getElementById("AjaxHolder_PostComment_Requiredfieldvalidator4"), document.getElementById("AjaxHolder_PostComment_RequiredFieldValidator3"));
//]]>
</SCRIPT>

<SCRIPT type=text/javascript>
//<![CDATA[
var AjaxHolder_PostComment_RequiredFieldValidator1 = document.all ? document.all["AjaxHolder_PostComment_RequiredFieldValidator1"] : document.getElementById("AjaxHolder_PostComment_RequiredFieldValidator1");
AjaxHolder_PostComment_RequiredFieldValidator1.controltovalidate = "AjaxHolder_PostComment_tbTitle";
AjaxHolder_PostComment_RequiredFieldValidator1.errormessage = "请输入标题";
AjaxHolder_PostComment_RequiredFieldValidator1.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
AjaxHolder_PostComment_RequiredFieldValidator1.initialvalue = "";
var AjaxHolder_PostComment_RequiredFieldValidator2 = document.all ? document.all["AjaxHolder_PostComment_RequiredFieldValidator2"] : document.getElementById("AjaxHolder_PostComment_RequiredFieldValidator2");
AjaxHolder_PostComment_RequiredFieldValidator2.controltovalidate = "AjaxHolder_PostComment_tbName";
AjaxHolder_PostComment_RequiredFieldValidator2.errormessage = "请输入你的姓名";
AjaxHolder_PostComment_RequiredFieldValidator2.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
AjaxHolder_PostComment_RequiredFieldValidator2.initialvalue = "";
var AjaxHolder_PostComment_Requiredfieldvalidator4 = document.all ? document.all["AjaxHolder_PostComment_Requiredfieldvalidator4"] : document.getElementById("AjaxHolder_PostComment_Requiredfieldvalidator4");
AjaxHolder_PostComment_Requiredfieldvalidator4.controltovalidate = "AjaxHolder_PostComment_CodeNumberTextBox";
AjaxHolder_PostComment_Requiredfieldvalidator4.errormessage = "请输入验证码";
AjaxHolder_PostComment_Requiredfieldvalidator4.display = "Dynamic";
AjaxHolder_PostComment_Requiredfieldvalidator4.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
AjaxHolder_PostComment_Requiredfieldvalidator4.initialvalue = "";
var AjaxHolder_PostComment_RequiredFieldValidator3 = document.all ? document.all["AjaxHolder_PostComment_RequiredFieldValidator3"] : document.getElementById("AjaxHolder_PostComment_RequiredFieldValidator3");
AjaxHolder_PostComment_RequiredFieldValidator3.controltovalidate = "AjaxHolder_PostComment_tbComment";
AjaxHolder_PostComment_RequiredFieldValidator3.errormessage = "请输入评论内容";
AjaxHolder_PostComment_RequiredFieldValidator3.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
AjaxHolder_PostComment_RequiredFieldValidator3.initialvalue = "";
var AjaxHolder_PostComment_ValidationSummary1 = document.all ? document.all["AjaxHolder_PostComment_ValidationSummary1"] : document.getElementById("AjaxHolder_PostComment_ValidationSummary1");
AjaxHolder_PostComment_ValidationSummary1.showmessagebox = "True";
AjaxHolder_PostComment_ValidationSummary1.showsummary = "False";
//]]>
</SCRIPT>

<SCRIPT type=text/javascript>
//<![CDATA[

var Page_ValidationActive = false;
if (typeof(ValidatorOnLoad) == "function") {
    ValidatorOnLoad();
}

function ValidatorOnSubmit() {
    if (Page_ValidationActive) {
        return ValidatorCommonOnSubmit();
    }
    else {
        return true;
    }
}
        
document.getElementById('AjaxHolder_PostComment_ValidationSummary1').dispose = function() {
    Array.remove(Page_ValidationSummaries, document.getElementById('AjaxHolder_PostComment_ValidationSummary1'));
}
Sys.Application.initialize();

document.getElementById('AjaxHolder_PostComment_RequiredFieldValidator1').dispose = function() {
    Array.remove(Page_Validators, document.getElementById('AjaxHolder_PostComment_RequiredFieldValidator1'));
}

document.getElementById('AjaxHolder_PostComment_RequiredFieldValidator2').dispose = function() {
    Array.remove(Page_Validators, document.getElementById('AjaxHolder_PostComment_RequiredFieldValidator2'));
}

document.getElementById('AjaxHolder_PostComment_Requiredfieldvalidator4').dispose = function() {
    Array.remove(Page_Validators, document.getElementById('AjaxHolder_PostComment_Requiredfieldvalidator4'));
}

document.getElementById('AjaxHolder_PostComment_RequiredFieldValidator3').dispose = function() {
    Array.remove(Page_Validators, document.getElementById('AjaxHolder_PostComment_RequiredFieldValidator3'));
}
//]]>
</SCRIPT>
</FORM>
<SCRIPT type=text/javascript>
        if (document.getElementById('cnblogsgooglead') != null) {
            document.getElementById('cnblogsgooglead').innerHTML = document.getElementById('cnblogsgoogleadcode').innerHTML;
            document.getElementById('cnblogsgoogleadcode').innerHTML = '';
        }

        if (document.getElementById('leftcontent') != null) {
            if (document.getElementById('leftcontent').style.display == 'none') {
                document.getElementById('leftcontent').style.display = 'inline';
            }
        }
        if (document.getElementById('Blogleftcontent') != null) {
            if (document.getElementById('cnblogsleftcontent').style.display == 'none') {
                document.getElementById('cnblogsleftcontent').style.display = 'inline';
            }
        }

        if (document.getElementById('cnblogsleftcontent') != null) {
            if (document.getElementById('cnblogsleftcontent').style.display == 'none') {
                document.getElementById('cnblogsleftcontent').style.display = 'inline';
            }
        }

        if (document.getElementById('rightmenu') != null) {
            if (document.getElementById('rightmenu').style.display == 'none') {
                document.getElementById('rightmenu').style.display = 'inline';
            }
        }
        if (document.getElementById('leftmenu') != null) {
            if (document.getElementById('leftmenu').style.display == 'none') {
                document.getElementById('leftmenu').style.display = 'inline';
            }
            if (document.getElementById('lefttemp') != null) {
                document.getElementById('leftmenu').innerHTML = document.getElementById('lefttemp').innerHTML;
                document.getElementById('lefttemp').innerHTML = '';
            }
        }

        if (document.getElementById('left') != null) {
            if (document.getElementById('left').style.display == 'none') {
                document.getElementById('left').style.display = 'inline';
            }
        }

        if (document.getElementById('cnblogsleftmenu') != null) {
            if (document.getElementById('cnblogsleftmenu').style.display == 'none') {
                document.getElementById('cnblogsleftmenu').style.display = 'inline';
            }
        }

        if (document.getElementById('menu') != null) {
            if (document.getElementById('menu').style.display == 'none') {
                document.getElementById('menu').style.display = 'inline';
            }
        }

        if (document.getElementById('cnblogsmenu') != null) {
            if (document.getElementById('cnblogsmenu').style.display == 'none') {
                document.getElementById('cnblogsmenu').style.display = 'inline';
            }
        }
    </SCRIPT>

<SCRIPT type=text/javascript>
	var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
	document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
	</SCRIPT>

<SCRIPT type=text/javascript>
	try {
	var pageTracker = _gat._getTracker("UA-476124-5");
	pageTracker._trackPageview();
	} catch(err) {}</SCRIPT>
</BODY></HTML>
